package com.xiaojie.feign.client;

import com.xiaojie.feign.FeignParam;
import com.xiaojie.feign.dto.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 参数绑定客户端
 *
 * @ClassName ParamClientController
 * @Description TODO
 * @Author wangye
 * @Date 2022/1/13
 **/
@RestController
@RequestMapping("/client/param")
public class ParamClientController {

    @Autowired
    private FeignParam feign;

    @RequestMapping("/test")
    public String test(String name) {
        return feign.test(name);
    }


    @RequestMapping("/test2")
    public User test2(String name) {
        return feign.test2(name);
    }

    @RequestMapping("/test3")
    public String test3(String name, Integer age) {
        return feign.test3(User.builder()
                .name(name).age(age).build());
    }
}
